<template>
	<view class="container">
		<view class="courierAddress" @click="chonseAddress">
			<view class="leftAddress">
				<!-- <text class="iconfont u-font44 u-02331F" style="color: #3775F6;">&#xe64c;</text> -->
				<!-- 有地址 -->
				<view class="addressTitle" v-if="value.id">
					<!-- <image class="address" :src="imgUrl+'/address/address.png'"></image> -->
					<image class="address" :src="imgUrl+'/address/address.png'"></image>
					<view>
					<view class="lnameView">
						<text class="lnameViewText">{{value.receiver}}</text>
						<text class="" v-if="value.mobile">{{value.mobile}}</text>
						<text class="" v-if="value.phone">{{value.phone}}</text>
					</view>
					
					
					<view class="hiddenDiss">
						{{value.province_name}}{{value.city_name}}
						{{value.area_name}}{{value.street_name}}{{value.community_name}}{{value.address}}
					</view>
					</view>
					
				</view>
				<!-- 默认没有地址 -->
				<view class="u-font30 u-ml20" v-else>
					暂无收货地址~
					<view class="u-999 u-mt5">
						立即添加收货地址
					</view>
				</view>
				
			</view>
			<image :src="imgUrl+'/personal/right.png'" class="personalRight"></image>
		</view>

	</view>
</template>

<script>
	export default {
		props: {
			link: {
				type: Boolean,
				default: true
			},
			value: {
				type: Object,
				default: function() {
					return {}
				}
			}
		},
		data() {
			return {
				imgUrl: this.$mConfig.staticUrl,
			}
		},
		methods: {
			chonseAddress() {
				if (this.link) {
					uni.navigateTo({
						url: '/pages/user/address/addressList'
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	.courierAddress {
		background-color: #fff;
		border-radius: 40rpx;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		width: 712rpx;
		height: 112rpx;
		background: #FFFFFF;
		border-radius: 19rpx 19rpx 19rpx 19rpx;
		margin:0 19rpx;
		padding:19rpx;
		box-sizing: border-box;
	}

	.hiddenDiss {
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		line-clamp: 2;
		-webkit-box-orient: vertical;
		width: 577rpx;
		height: 27rpx;
		font-weight: 400;
		font-size: 25rpx;
		color: #000000;
		line-height: 27rpx;
		text-align: left;
		font-style: normal;
		text-transform: none;
		margin-top: 19rpx;
	}
	.addressView{
		font-weight: 400;
		font-size: 27rpx;
		color: #333333;
		line-height: 38rpx;
	}
	.lnameView{
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
		font-weight: 600;
		font-size: 27rpx;
		color: #000000;
		line-height: 27rpx;
	}
	.lnameViewText{
		margin-right: 19rpx;
	}
	.personalRight{
		width:12rpx;
		height:23rpx;
	}
	.leftAddress{
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}
	.address{
		width: 39rpx;
		height: 39rpx;
		margin-right: 16rpx;
	}
	.addressTitle{
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
	}
</style>